package com.wjl.web.meta;

import cn.hutool.core.io.resource.ResourceUtil;
import cn.hutool.json.JSONUtil;
import com.wjl.maker.meta.Meta;

public class MetaManager {

    private  static volatile Meta meta;

    public static Meta getMeta() {
        if (meta == null) {
            synchronized (MetaManager.class) {
                if (meta == null) {
                    meta=initMeta();
                }
            }
        }
        return meta;
    }

    public static Meta initMeta() {
        String s = ResourceUtil.readUtf8Str("springboot-init.json");
        Meta bean = JSONUtil.toBean(s, Meta.class);
        return bean;
    }
}
